CustomerAddWinCtl = Ext.extend(CmpControler, {

			bulidComponent : function() {

				var config = this.getCommonConfig();

				config = this.configItems(config);

				config = this.configButtons(config);

				var win = new Ext.Window(config);

				return win;
			},
			getCommonConfig : function() {
				
				var gcc = cf.getC('gcc');
				
				var config = {
					width : gcc.sw * 0.8,
					height : gcc.sh * 0.7,
					//autoHeight : true,
					// frame : true,
					layout : 'fit',
					title : '发布',
					closeAction : 'hide'
				};

				return config;

			},
			configItems : function(config) {

				var cafc = cf.getC('cafc');

				config.items = cafc.getComponent();

				return config;
			},
			configButtons : function(config) {

				config.buttons = [{
							text : '保存',
							handler : this.save,
							scope : this
						}, {
							text : '提交',
							handler : this.submit,
							scope : this
						}, {
							text : '取消',
							handler : function() {
								this.cmp.hide();
							},
							scope : this
						}];

				config.buttonAlign = 'center'

				return config;

			},
			show : function() {

				var cafc = cf.getC("cafc");
				cafc.reset();

				this.cmp.show();

			},
			create : function() {

			},
			submitBack : function(response) {

			},
			getCombobox : function() {

				var config = {
					// typeAhead : true,
					fieldLabel : '发布目标',
					// width : 300,
					triggerAction : 'all',
					mode : 'local',
					editable : false
				};
				config = this.configCbbStore(config);

				var combobox = new Ext.form.ComboBox(config);
				this.cbb = combobox;

				return combobox;

			},
			configCbbStore : function(config) {

				var url = this.getCbbStoreUrl();

				var storeConfig = {
					url : url,
					root : "items",
					// totalProperty : "totalCount",
					id : 'destId',
					fields : ["destId", "destName"]
				}

				var dataStore = new Ext.data.JsonStore(storeConfig);

				config.store = dataStore;
				config.valueField = 'destId';
				config.displayField = 'destName';

				this.cbbStore = dataStore;
				dataStore.load();

				return config;

			},
			getCbbStoreUrl : function() {
				var s = cf.getC('s');
				var url = s.getUrl({
							resource : 'ugcDestList.do',
							act : 'r'
						});

				return url;
			},
			getValue : function() {
				return this.cbb.getValue();
			},
			save : function() {

				var cafc = cf.getC('cafc');
				cafc.items[19].setValue(0);
				cafc.submit();
				this.cmp.hide();

			},
			submit : function() {

				var cafc = cf.getC('cafc');
				cafc.items[19].setValue(1);
				cafc.submit();
				this.cmp.hide();

			}

		});
